#ifndef RS422_SERIAL_PORT_H
#define RS422_SERIAL_PORT_H

#include <QWidget>
#include <QSerialPort>
#include <QSerialPortInfo>
#include "QDebug"
#include <QVBoxLayout>
#include <QLabel>
#include "util/util.h"

#include <iostream>
#include <cstring>
#include <fcntl.h>
#include <termios.h>
#include <unistd.h>


namespace Ui {
class rs422_serial_port;
}

class rs422_serial_port : public QWidget
{
    Q_OBJECT

public:
    explicit rs422_serial_port(QWidget *parent = 0);
    ~rs422_serial_port();


    void setScrollArea(QStringList &SerialPorts);

private:
    Ui::rs422_serial_port *ui;

    QVBoxLayout* layout;
    QSerialPort *m_serialPort;


signals:
    void returnMenu();

private slots:
    void pushReturnMenu();
    void getAvailablePorts();
    void sendSerialInfo();
    void readSerialInfo();
};

#endif // RS422_SERIAL_PORT_H
